package com.ruoyi.web.controller.fx;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.fx.statistic.IStatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/fx/statistic")
public class StatisticController {

    @Autowired
    private IStatisticService statisticService;

    /**
     * 顶部统计
     *
     * @return
     */
    @GetMapping(value = "/topStatistic")
    public AjaxResult getTop() {
        return AjaxResult.success(statisticService.selectTop());
    }

    /**
     * 用户增涨统计图
     * @return
     */
    @GetMapping("/getUserChart")
    public AjaxResult getUserChart() {
        return AjaxResult.success(statisticService.selectUserChart());
    }

    /**
     * 订单类型 饼图
     * @return
     */
    @GetMapping("/getOrderChart")
    public AjaxResult getOrderChart(Long number) {
        return AjaxResult.success(statisticService.selectOrderChart(number));
    }

    /**
     * 商家统计
     * @param storeId 商家id
     * @return
     */
    @GetMapping("/getStore")
    public AjaxResult getStore(Long storeId){
        return AjaxResult.success(statisticService.selectStore(storeId));
    }

    /**
     * 供应商统计
     *
     * @param supplierId 供应商id
     * @return
     */
    @GetMapping("/getSupplier")
    public AjaxResult getSupplier(Long supplierId) {
        return AjaxResult.success(statisticService.selectSupplier(supplierId));
    }

}
